package com.sojson.util.file.enums;

/**
 * 文件流对应文件类型
 * 
 * @author liu
 * @date 2021-04-16
 */
public enum EFileType {

    // FileTypeUtil
    /** Windows Media */
    ASF("3026B2758E66CF11", "asf", "video/x-ms-asf"),
    /** AVI */
    AVI("41564920", "avi", "video/x-msvideo"),
    /** bat */
    BAT("406563686f206f66660d", "bat", "application/x-msdownload"),
    /** 16色位图(bmp) */
    BMP16("424D228C010000000000", "bmp", "image/bmp"),
    /** 24位位图(bmp) */
    BMP24("424D8240090000000000", "bmp", "image/bmp"),
    /** 256色位图(bmp) */
    BMP256("424D8E1B030000000000", "bmp", "image/bmp"),
    /** CHM Archive */
    CHM("49545346030000006000", "chm", "application/vnd.ms-htmlhelp"),
    /** CLASS Archive */
    CLASS("CAFEBABE0000002E0041", "class", "application/octet-stream"),
    /** css */
    CSS("48544D4C207B0D0A0942", "css", "text/css"),
    /** outlookExpress */
    DBX("CFAD12FEC5FD746F", "dbx"),
    /** doc */
    DOC("D0CF11E0", "doc", "application/msword"),
    /** docx */
    DOCX("504B030414000600080000002100", "docx",
        "application/vnd.openxmlformats-officedocument.wordprocessingml.document"),
    /** CAD */
    DWG("41433130313500000000", "dwg", "application/acad"),
    /** email */
    EML("44656C69766572792D646174653A", "eml", "message/rfc822"),
    /** eps */
    EPS("252150532D41646F6265", "eps", "application/postscript"),
    /** EXE Archive */
    EXE("4d5a9000030000000400", "exe", "application/x-msdownload"),
    /** FLV */
    FLV("464C5601050000000900", "flv", "video/x-flv"),
    /** gif */
    GIF("4749463837", "gif", "image/gif"),
    /** gif */
    GIF_2("4749463839", "gif", "image/gif"),
    /** html */
    HTML("68746D6C3E", "html", "text/html"),
    /** int */
    INI("235468697320636f6e66", "ini"),
    /** JAR */
    JAR("504B03040a0000000000", "jar", "application/java-archive"),
    /** JAR */
    JAR_2("504B0304140008000800", "jar", "application/java-archive"),
    /** JAVA Archive */
    JAVA("7061636b616765207765", "java", "text/x-java-source"),
    /** jpg */
    JPG("FFD8FF", "jpg", "image/jpg"),
    /** jpeg */
    JPEG("FFD8FF", "jpeg", "image/jpeg"),
    /** js */
    JS("696B2E71623D696B2E71", "js", "application/javascript"),
    /** JSP Archive */
    JSP("3c25402070616765206c", "jsp"),
    /** mdb */
    MDB("5374616E64617264204A", "mdb", "application/x-msaccess"),
    /** MF Archive */
    MF("4D616E69666573742D56", "mf"),
    /** MIDI */
    MID("4D546864", "mid", "audio/midi"),
    /** Quicktime */
    MOV("6D6F6F76", "mov", "video/quicktime"),
    /** MP3 */
    MP3("49443303000000002176", "mp3", "audio/mpeg"),
    /** MP4 */
    MP4("00000020667479706", "mp4", "video/mp4"),
    /** MP4 */
    MP4_2("00000020667479706d70", "mp4", "video/mp4"),
    /** MPEG */
    MPG("000001BA", "mpg", "video/mpeg"),
    /** pdf */
    PDF("255044462D312E", "pdf", "application/pdf"),
    /** png */
    PNG("89504E47", "png", "image/png"),
    /** properties */
    PROPERTIES("2323232323232323232323", "properties"),
    /** properties */
    PROPERTIES_2("737072696E672E63616368", "properties"),
    /** adobePhotoshop */
    PSD("38425053", "psd", "image/vnd.adobe.photoshop"),
    /** pst */
    PST("2142444E", "pst"),
    /** Windows Password */
    PWL("E3828596", "pwl"),
    /** Quicken */
    QDF("AC9EBD8F", "qdf"),
    /** Real Audio */
    RAM("2E7261FD", "ram", "audio/x-pn-realaudio"),
    /** RAR Archive */
    RAR("526172211a0700cf9073", "rar", "application/x-rar-compressed"),
    /** Real Media */
    RM("2E524D46", "rm", "application/vnd.rn-realmedia"),
    /** richTextFormat */
    RTF("7B5C727466", "rtf", "text/rtf"),
    /** txt */
    TEXT("", "txt", "text/plain"),
    /** tiff */
    TIF("49492A00227105008037", "tif", "image/tiff"),
    /** torrent */
    TORRENT("6431303A637265617465", "torrent", "application/x-bittorrent"),
    /** vsd */
    VSD("d0cf11e0a1b11ae10000", "vsd", "application/vnd.visio"),
    /** Wave */
    WAV("57415645", "wav", "audio/x-wav"),
    /** wpd */
    WPD("FF575043", "wpd", "application/vnd.wordperfect"),
    /** wps */
    WPS("d0cf11e0a1b11ae10000", "wps", "application/vnd.ms-works"),
    /** xls */
    XLS("d0cf11e0a1b11ae10", "xls", "application/vnd.ms-excel"),
    /** xlsx */
    XLSX("504B030414000600080000002100", "xlsx", "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),
    /** xml */
    XML("3C3F786D6C", "xml", "application/xml"),
    /** ZIP Archive */
    ZIP("504B0304", "zip", "application/zip"),
    /** Null */
    NULL("", "0000");

    /** 类型代码 */
    private String code;
    /** 类型名称 */
    private String name;
    /** 类型名称(带.) */
    private String nameD;
    /** MimeType */
    private String mimeType = "";

    private EFileType(String code, String name) {
        this.code = code;
        this.name = name;
        this.nameD = "." + name;
    }

    private EFileType(String code, String name, String mimeType) {
        this.code = code;
        this.name = name;
        this.nameD = "." + name;
        this.mimeType = mimeType;
    }

    /**
     * 获取类型代码
     * 
     * @return
     */
    public String getCode() {
        return code;
    }

    /**
     * 设置类型代码
     * 
     * @param code
     */
    public void setCode(String code) {
        this.code = code;
    }

    /**
     * 获取类型名称
     * 
     * @return
     */
    public String getName() {
        return name;
    }

    /**
     * 设置类型名称
     * 
     * @param name
     */
    public void setName(String name) {
        this.name = name;
    }

    /**
     * 获取类型名称(带.)
     * 
     * @return
     */
    public String getNameD() {
        return nameD;
    }

    /**
     * 设置类型名称(带.)
     * 
     * @param nameD
     */
    public void setNameD(String nameD) {
        this.nameD = nameD;
    }

    /**
     * 获取MimeType
     * 
     * @return
     */
    public String getMimeType() {
        return mimeType;
    }

    /**
     * 设置MimeType
     * 
     * @param mimeType
     */
    public void setMimeType(String mimeType) {
        this.mimeType = mimeType;
    }

}